package Homework.two;

import java.io.*;

public class Test3 {
    public static void main(String[] args) throws IOException {
     File file = new File("./");
     File list[] = file.listFiles(f -> f.getName().endsWith(".txt"));
        for(File lists : list){
            BufferedInputStream bis = new BufferedInputStream(new FileInputStream(lists));
            BufferedOutputStream bos = new BufferedOutputStream((new FileOutputStream(lists+"_cp.txt")));
            int b;
            while(( b= bis.read())!=-1){
                bos.write(b);
            }
            bos.close();
            bis.close();
        }

}
}
